package hu.arguscab.ai.game;

import hu.arguscab.ai.FitnessFunction;
import hu.arguscab.ai.Model;
import hu.arguscab.game.WorldState;

/**
 *
 * @author sharp
 */
public class FStop extends FitnessFunction {

	@Override
	public float getMinValue() {
		return 0;
	}

	@Override
	public float getMaxValue() {
		return 20;
	}

	@Override
	public float calcF(Model m) {
		WorldState state = (WorldState)m.getState();
		float v = Math.max(state.getShipState().getV().getLength(), state.getShipState().getA().getLength());
		return 20-v;
	}
}
